package com.rockgle.reader;

import android.view.View;
import android.view.View.OnClickListener;

public class EntryViewOnClickListener implements OnClickListener{
	private EntryViewer activity;
	public EntryViewOnClickListener(EntryViewer activity){
		this.activity = activity;
	}

	@Override
	public void onClick(View v) {
		int showed = activity.getCurrentEntryShowed();
		int id = v.getId();
		if(id == R.id.ButtonUP && showed>0){
			showed--;
		}else if(id == R.id.ButtonDOWN && !activity.isShowingLast()){
			showed++;
		}
		activity.showEntry(showed);
	}
}